package org.gd.spring.hibernate.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;

/**
 * @author Gorhover
 */
@Embeddable
public class Address implements Serializable {

    @Column(name = "CITY")
    private String city;
    @Column(name = "STREET")
    private String street;
    @Column(name = "BUILD")
    private Integer build;

    /**
     * need for jaxb
     * @deprecated use {@link #Address(String, String, Integer)}
     */
    @Deprecated
    public Address() {
    }

    public Address(String city, String street, Integer build) {
        this.city = city;
        this.street = street;
        this.build = build;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public Integer getBuild() {
        return build;
    }

    public void setBuild(Integer build) {
        this.build = build;
    }

    @Override
    public String toString() {
        return "Address{" +
                "city='" + city + '\'' +
                ", street='" + street + '\'' +
                ", build=" + build +
                '}';
    }
}
